#!/usr/bin/env python
# -*- coding:utf-8 -*-

# file:homework2_8.py
# author:wmf
# datetime:2021/4/4 23:50
# software: PyCharm
'''
this is function description
'''
# import module your need

#8  请用Python定义一个函数，给定一个字符串，
# 找出该字符串中出现次数最多的那个字符，
# 并打印出该字符及其出现的次数。
# 例如，输入 aaaabbc，输出：a:4

def Letter_Count(str1):
    dict1 = {}
    for x in str1:
        if(x in dict1):
            dict1[x] = dict1[x] + 1
        else:
            dict1[x] = 1
    v = -1
    for key,value in dict1.items():
        if(value > v):
            v = value
            a = key
    print(a,end=' ')
    print(':',end=' ')
    print(v)

str1 = "Hello World!!"

print("字符串为:%s"%str1)
print("出现最多次数的字符:次数")
Letter_Count(str1)